<template>
<div class="wrap">
    <xcl-header :page-title="pageTitle" :header-right="headerRight"></xcl-header>
    <div class="content">

	 <div class="list-block">
	    <ul>
	      <li class="item-content item-link">
	        <div class="item-inner" v-link="{path:'/User/Setting/ModifyAutoentication'}">
	          <div class="item-title">认证信息</div>
	          <div class="item-after">{{user.authentication}}</div>
	        </div>
	      </li>
	      <li class="item-content item-link">
	        <div class="item-inner" v-link="{path:'/User/Setting/ModifyPhone'}">
	          <div class="item-title">绑定手机</div>
	          <div class="item-after">{{ user.phoneNumber | hideNumber 3 4 }}</div>
	        </div>
	      </li>
	      <li class="item-content item-link">
	        <div class="item-inner" v-link="{path:'/User/Setting/ModifyNIckName'}">
	          <div class="item-title">昵称</div>
	           <div class="item-after">{{ user.nickName }}</div>
	        </div>
	      </li>
	    </ul>
	</div>
	
	<div class="list-block" style="margin:0.5rem 0">
	    <ul>
	      <li class="item-content item-link">
	        <div class="item-media"><i class="icon icon-f7"></i></div>
	        <div class="item-inner" style="margin-left:0" v-link="{path:'/ModifyPassword'}">
	          <div class="item-title" >修改密码</div>
	          <div class="item-after"></div>
	        </div>
	      </li>
	    </ul>
  	</div>

</div>
  <xcl-loading :show="loading.show"></xcl-loading>
  </div>
</template>
<script>
import xclHeader from '../components/header.vue'
import xclFooter from '../components/footer.vue'
import xclLoading from '../components/loading.vue'
let UserProxy =  require("../proxy/user_proxy");
let User = new UserProxy();
  export default {
        data (){
            return {
                scroll:true,
                pageTitle:'帐号及安全设置',
                headerRight:'', 
                user:{
                	authentication:'',
                	nickName:localStorage.nickName,
                	phoneNumber:localStorage.phoneNumber
                }, 
                myProducts:[],            
                	loading:{
                    show:false
                },
                loading:{
                	show:false
                }
            }
        },
        route:{
        },
        methods:{
        	getMyProducts(){
        		var _this = this;
        		_this.loading.show = true;
        		User.isRegisterFinish(localStorage.token,(d)=>{
        			if(d.code == 200 && d.results && d.results.length){
                        var getcode = d.results[0];
                        if(((getcode&4)==4) && ((getcode&8)==8)){
                            _this.user.authentication = '已认证';
                            localStorage.authentication = 1 ;
                        }else{
                            _this.user.authentication = '未认证';
                            localStorage.authentication = 0;
                        }
        			}else if(d.code == 4090){
                      localStorage.removeItem('token');
                      _this.$router.go('/Login'); 
                    }else{

                    }
        			_this.loading.show = false;
        		});
        	}
        },
        ready(){
            this.getMyProducts();
        },
        components:{
           "xclHeader":xclHeader,
           "xclFooter":xclFooter,
           "xclLoading":xclLoading
        }
  }
</script>